package pub.wkq.springframework.test.bean;

import pub.wkq.springframework.beans.factory.DisposableBean;
import pub.wkq.springframework.beans.factory.InitializingBean;

public class UserService implements InitializingBean, DisposableBean {
    private String userId;
    private String company;
    private String location;
    private UserDao userDao;


    public String queryUserInfo() {
        return userDao.queryUserName(userId) + ",公司：" + company + ",地点：" + location;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("userService 销毁中");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("userService 初始化中");
    }
}
